\begin{answer}{epiandpie}
This is question 6.6 from \citet{JoshiQA}.
It is similar to the previous question as it also requires a rewrite trick followed by some calculus.
There is no intuitive solution.
If you evaluate
$e^\pi$
and
$\pi^e$
numerically, one of them is
$22.46$
and the other one is
$23.14$.
This makes it a beautiful question, but the beauty can quickly evaporate if your first encounter is during an interview.
Now for the trick: you have two expressions,
\begin{align*}
&
e^\pi
\\
&
\pi^e
\end{align*}
and you can take the natural logarithm of both without affecting their relative order:
\begin{align*}
&
\log(e^\pi)
\\
&
\log(\pi^e)
\text{.}
\end{align*}
You can also divide both expressions by $\pi e$ without influencing their order, since $\pi e$ is positive,
\begin{align*}
\frac{\log(e^\pi)}{e \pi}
&=
\frac{\pi\log(e)}{e \pi}
=
\frac{\log(e)}{e}
\\
\frac{\log(\pi^e)}{e \pi}
&=
\frac{e \log(\pi)}{e \pi}
=
\frac{\log(\pi)}{\pi}
\text{.}
\end{align*}
Now you've changed the original question into one about the behaviour of the function
\begin{equation}
\label{eq:eandpi:logxoverx}
\frac{\log(x)}{x}
\end{equation}
in the region near $e$ and $\pi$.
Specifically, you want to know whether (\ref{eq:eandpi:logxoverx}) is increasing or decreasing over this region.
So you take its derivative, using the product rule
\begin{align*}
\frac{d}{dx}
\frac{\log{x}}{x}
 &=
\log x
\frac{d}{dx}
\frac{1}{x}
+
\frac{1}{x}
\frac{d}{dx}
\log{x}
\\
 &=
 -
\log x
\frac{1}{x^2}
+
\frac{1}{x^2}
\\
 &=
\frac{1}{x^2}
\left(
1 - \log x
\right)
\text{.}
\end{align*}
Now you can evaluate the nature of the function at the two points.
At $e$ you have
\begin{align*}
\frac{1}{e^2}
\left(
1 - \log e
\right)
=0
\end{align*}
and at $\pi$ you have
\begin{align*}
\frac{1}{\pi^2}
\left(
1 - \log \pi
\right)
\text{.}
\end{align*}
Here, the sign will only depend on the sign of
$(1 - \log \pi)$.
You know that $\pi$ is slightly larger than $e$
($\pi \approx 3.14$ and $e \approx 2.71$)
so you can write
\begin{equation}
\label{eq:eandpi:epower1plusk}
(1 - \log \pi)
=
(1 - \log e^{1 + k})
\end{equation}
where $k$ is some small positive quantity.
Then
$(1 - \log \pi) =
(1 - (1 + k) ) = - k $ which is negative.
Writing it with the $k$ as in (\ref{eq:eandpi:epower1plusk}) actually helps to solve the problem.
At $e$, the derivative is 0, so you know it has a critical point there.
For all the values thereafter, $k$ will be increasing so the derivative will be negative, implying the function $f(x)=\nicefrac{\log(x)}{x}$ is decreasing after $e$.
Below is a plot of the function with the important points highlighted.
\begin{center}
\begin{tikzpicture}[scale=1.5]
\datavisualization [scientific axes={clean},
                    visualize as smooth line,
                    y axis={label={$\frac{\log(x)}{x}$}, ticks={quarter about strategy}},
                    x axis={label={$x$}, ticks={major={at={1,2,3,4,(e) as $e$, (pi) as $\pi$}}} , grid={major={at={(e),(pi)}}}}
                    ]
data[format=function] {
var x : interval [0.9:4.1];
func y = ln(\value x) / \value x ;
};
\end{tikzpicture}
\end{center}
That means
\begin{align*}
\frac{\log(e)}{e}
&>
\frac{\log(\pi)}{\pi}
\\
e^\pi
&>
\pi^e
\end{align*}
and a calculator confirms this,
\begin{align*}
e^\pi &= 23.14
\\
\pi^e &= 22.46
\text{.}
\end{align*}
\end{answer}
